#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_BlueToothMeasurementSystem.h"

#include <QtSerialPort/QtSerialPort> 

class BlueToothMeasurementSystem : public QMainWindow
{
	Q_OBJECT

public:
	BlueToothMeasurementSystem(QWidget *parent = Q_NULLPTR);
	void openSerialPort(bool isAuto);
	void initData();
	void diyUi();
	void createAction();
	bool writeDataToSerialPort(int type, int para = 0);


	private slots:
	void SlotRefreshSerialPort();
	void SlotOpenSerialPort();
	void onEndRxIcon();
	void onEndTxIcon();
	void slotReadSerialPort();
	void SlotScreenSwitch();
	void SlotTabSwitch();
	void SlotStart();

private:
	Ui::BlueToothMeasurementSystemClass ui;

	QList <QSerialPortInfo> m_infoList;
	bool m_isSerialPortOpen;
	QSerialPort* m_currentSerialPort;
	QTimer *m_myTimer_Rx;
	QTimer *m_myTimer_Tx;

	//QDateTime m_msgSendTime;
	int m_currentOrder;
};
